package com.wnx.db;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.query.Query;

import com.wnx.entity.Admin;
import com.wnx.util.HibernateUtil;

public class FirstDao {
	public List getAdminall(){
		Session session = HibernateUtil.getSession();
		session.beginTransaction();
		String hql = "from Admin";
		Query<Admin> query = session.createQuery(hql,Admin.class);
		List list=query.list();
		session.getTransaction().commit();
		session.close();
		return list;
	}
}
